package com.cn.jx.manager.service.query;

import java.util.List;
import java.util.Set;

import com.cn.jx.common.util.page.PageObj;
import com.cn.jx.manager.po.Resource;
import com.jx.enumType.ApplyEnum;
import com.jx.jpaQuery.QueryCondition;
import com.jx.model.MenuEntry;
import com.jx.util.MapObject;


/**
 * 
 * @author 姜旭
 * @version v1.11.20.2019
 * @since 
 * <p>创建时间：2019年12月1日
 * <p>功能描述：<p>IResourceServiceQry  资源服务查询接口
 * <p>官方网站：management/admin/index
 * <p>邮箱地址：524577360@qq.com
 */
public interface IResourceServiceQry {
	
	/**
	 * 
	* @Title:findResourceByPageAndParams
	* @Description:TODO(分页查询资源)
	* <p>邮箱地址: 524577360@qq.com
	* @param cond
	* @return
	* @throws Exception
	* PageObj<Resource>
	* @throws
	 */
	public PageObj<MapObject> findResourceByPageAndParams(QueryCondition cond)  throws Exception;
	
	/**
	 * 
	* @Title:findResourceTree
	* @Description:TODO(根据根资源获取资源树  左侧菜单)
	* <p>邮箱地址: 524577360@qq.com
	* @return
	* List<MenuEntry>
	* @throws
	 */
	public List<MenuEntry> findResourceTree(ApplyEnum apply,String parent,List<String> permissions);
	
	/**
	 * 
	* @Title:getResourceById
	* @Description:TODO(获取资源对象)
	* <p>邮箱地址: 524577360@qq.com
	* @throws
	 */
	public Resource getResourceById(String id) ;
	
	/**
	 * 
	* @Title:findResourceTreeMgr
	* @Description:TODO(资源管理和资源分配选择)
	* <p>邮箱地址: 524577360@qq.com
	* @throws
	 */
	public List<MenuEntry> findResourceTreeMgr(String parent);
	
	/**
	 * 
	* @Title:findRootResource
	* @Description:TODO(查询应用下面的根资源)
	* <p>邮箱地址: 524577360@qq.com
	* List<MenuRootEntry>
	* @throws
	 */
//	public List<MenuRootEntry> findRootResource(String apply,List<String> permissions);
	
	/**
	 * 
	* @Title:findResourceRoleTree
	* @Description:TODO(角色分配资源权限控件资源列表)
	* <p>邮箱地址: 524577360@qq.com
	* @throws
	 */
	public List<MenuEntry> findResourceRoleTree(String parent,Set<String> selectedRes);
	
	
	/**
	 * 
	* @Title:findResourceCountByParent
	* @Description:TODO(根据父节点查询子项目数量 查询此节点下面有没有子项目)
	* <p>邮箱地址: 524577360@qq.com
	* @throws
	 */
	public Integer findResourceCountByParent(List<String> ids) throws Exception;
	
	/**
	 * 
	* @Title:findAllResourceCode
	* @Description:TODO(获取所有资源)
	* <p>邮箱地址: 524577360@qq.com
	* @return
	* List<Resource>
	* @throws
	 */
	public List<Resource> findAllResource();
	
	/**
	 * 
	* @Title:findAllResourceByIds
	* @Description:TODO(获取所有资源id)
	* <p>邮箱地址: 524577360@qq.com
	* @param ids
	* @return
	* List<Resource>
	* @throws
	 */
	public List<Resource> findAllResourceByIds(List<String> ids);
	
	/**
	 * 
	* @Title:findAllResourceCount
	* @Description:TODO(系统第一次启动判断资源是否存在)
	* <p>邮箱地址: 524577360@qq.com
	* @return
	* int
	* @throws
	 */
	public List<String> findAllResourceCode();
	
	/**
	 * 
	* @Title: findAllResourceByParent
	* @Description: TODO(这里用一句话描述这个方法的作用)
	* <p>邮箱地址：524577360@qq.com
	* @param parentId
	* @return
	* @return List<Resource> 返回类型
	* @throws
	 */
	public List<Resource> findAllResourceByParent(String parentId);
	
	/**
	 * 
	* @Title:findAllResourceByParentCode
	* @Description:TODO(这里用一句话描述这个方法的作用)
	* <p>邮箱地址: 524577360@qq.com
	* @param parentCode
	* @return
	* List<Resource>
	* @throws
	 */
	public List<Resource> findAllResourceByParentCode(String parentCode);
}
